DOWN

Introduction

The recovery of fluorescence after photoblanqueo (frap) is a technique widely used in biology and biomedicine to study the mobility and dynamics of molecules in living cells.The quantification of fluorescence during the frap process allows to obtain valuable information about the recovery of the molecules marked with fluorophores after being photoblanqueted.

In this manual an advanced methodology is presented for the analysis of the recovery of fluorescence in the frap technique (Fluorescence Recovery after Photobleaching).The main objective is to provide researchers with a complete tool that allows them to understand and quantify the dynamics of molecules in living cells through the FRAP technique.

The content of this manual covers the following key points:

  1. FUNDAMENTALS OF THE FRAP TECHNIQUE: A detailed description of the fundamental principles of the FRAP technique is provided, including the basic concepts of photoblanqueo, recovery of fluorescence and the use of fluorophores in Frap experiments.

  2. Fluorescence recovery models: different mathematical and statistical models are introduced to describe the recovery of fluorescence after photoblanqueo.The theoretical foundations of each model are explained and examples of its application in the Frap data analysis are shown.

  3. Curve adjustment and parameter estimation: A methodology is presented to adjust fluorescence recovery curves to the experimental data obtained by Frap.Optimization techniques are discussed and practical tools are provided to estimate the parameters of the recovery model.

  4. RESULT ANALYSIS AND QUALITY EVALUATION: The evaluation of the quality of the adjustment of fluorescence recovery curves through statistical methods and visualization of results is addressed.The criteria to determine the goodness of adjustment are discussed and graphic tools are presented to analyze and compare the results obtained.

  5. Data simulation and validation of the model: The stocastic simulation process of fluorescence recovery curves based on the estimated parameters is explained.The importance of simulation is discussed in the Frap analysis and tools are provided to validate the recovery model through comparison with real data.

In summary, this manual offers a complete and practical guide for the analysis of fluorescence recovery in the frap technique.Researchers will find in this manual a useful reference to understand the theoretical foundations, apply statistical models, adjust curves, evaluate results and perform simulations that allow a rigorous and quantitative analysis of the data obtained by Frap.

Get start

In the [Frapping] parcel (https://github.com/artitzco/fraping) the necessary functions are implemented to perform the analysis of Frap data.However, for it to work correctly, it is also necessary to install the [ITZ] (https://github.com/artitzco/itz).Both are repositories of [github] (https://github.com), and their installation is carried out using the install_github of the package [devotools] (https://rdocumentation.org/packages/devtools/versiones/2.4.3) of R.

{r evali = false} devotools :: install_github ("Artitzco/Itz") devotools :: install_github ("Artitzco/Frapping")

In this way, the bookstores will be installed on their equipment, so every time a new project for the analysis of Frap data, it will only have to import the corresponding bookstores:

{r evali = false} Library (Itz) Library (Frapping)


** Start now (optional) **

If you want to start using the Frapping bookstore immediately, you can download a set of example data using the DownloadData function.This function will download a file with FRAP data in the “Data” folder within your work directory, which you can use as a starting point to practice the analysis methods described in this manual.Keep in mind that this download is optional and you can use your own frap data if you have them available.

If you want to use the example data, run the following code on the R:Frapping :: DownloadData ()command console.After executing this function, in addition to the “Data” folder, you will find a test script called “Test.fraping.R” at the root of the Board of Directors.You can use this script as a starting point to explore and analyze frap data.


The NewdataFrap function creates a basis for a new Frap data group, the function synthesizes the information and returns a list that allows the user to manipulate their data more easily.The parameters it admits are the name of the group and the intensity of photoblanqueo in percentage.For more details go to [Newdatafrap] (#Newdatafrap).

To avoid future problems, the group’s name must meet the following recommendations:

  1. You should not include spaces,
  2. It must initial with a letter,
  3. Special characters are only admitted. “and”_“.

{r evali = false} A <- Newdatafrap ("Neurites", 80) B <- Newdatafrap ("Secondary.neurites", 80) C <- Newdatafrap ("dendrites", 80) Remember to follow these recommendations when creating new Frap data groups.This will ensure the consistency and correct manipulation of the data in future analysis.

Import data FRAP

Once the data groups have been initialized, it is time to add the information.One way to do it is through the adddir function of thenewdatafrap object.This function requires that the user organize the Frap tables in three files in his team: the first with the recovery data, the second with the control tables and the third with the background information.

The Adddir function of the Frapping parcel accepts the following parameters to add the information of the Frap data files:

  • Seconds: Duration of the experiment in seconds.
  • Photo: frame index in which photoblanqueo is applied.
  • Areacolumn: Name of the column that contains the area data.
  • Inputcolumn: Name of the column that contains the intensity data.
  • Dirr: Recovery data file route.
  • DIRC: Control data file route.
  • dirb: background data file route (optional).

It is important to keep in mind that the background data is optional.If you decide to omit the information on the background data file, you should consider that this will have a direct impact on the standardization of the data during the analysis.

Below is an example of how to use the adddir:

`` {r evali = false} A $ ADDDIR (480, 4, “Area”, “Intden”, “Data/Gfp/Gfp Secondary Neurite”, “Data/GFP/GFP Secondary Neurite Control”, “Data/GFP/GFP Secondary Neurite Back”)

B $ Adddir (480, 4, “Area”, “Intden”, “Data/Lifeact Gfp/Lifeact Gfp Secondary Neurite”, “Data/Lifeact Gfp/Lifeact Gfp Secondary Neurite Control”, “Data/Lifeact GFP/Lifeact GFP Secondary Neurite Back”)

C $ Adddir (480, 4, “Area”, “Intden”, “Data/Lifeact Gfp/Lifeact Gfp dendrite”, “Data/Lifeact Gfp/Lifeact Gfp dendrite Control”, “Data/Lifeact GFP/Lifeact GFP dendrite Back”) ``

When creating a new data group using the NewdataFrap function, a random color is automatically assigned to the group.This color is used to differentiate it from others in the graphs.If you want to reallocate a specific color to the group, you can use the setcolor of theNewdataFrap object.This function accepts as a parameter the color value in hex format, or you can choose a predefined color of the vector Grdevices :: Colors () or use the color of the parcel color [Itz] (https://github.com/Artitzco/Itz).

{r evali = false} A $ setcolor ("#05753D") B $ setcolor ("#0000a6") C $ setcolor ("#E014F7")

Before making a parametric adjustment, you may prefer to visualize the data through graphics to make a visual inspection.To achieve this, you can use the Plotrecover, which accepts as parameters the bases created withNewdatafrap.You can customize the graphics using various parameters.For more details about this function, consult [Plotrecover] (#plotrecover).

{r evali = false} plotrecover (a, b, c, plot.lines = t)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/001.jpg")#>>> <<<

{r evali = false} Plotrecover (A, B, C, Plot.Shadow = T, Plot.mean = T)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/002.jpg")#>>> <<<

{r evali = false} plotrecover (a, b, c, plot.pints = t)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/003.jpg")#>>> <<<

Choose a probability model

The proposed parametric model to describe the behavior of the fluorescence recovery curve curve from the moment of photoblanqueo is as follows:

\[ f (t) = f_ {min}+\ alpha \, (1-f_ {min}) \, p (t-t_0 | \ theta), \] Where $ p $ is a function of accumulated distribution parameterized for $  theta $, $ t_0 $ is the photoblanqueo time and $ f_ {min} $ is the minimum value of fluorescence after photoblanqueo, the theoretical value $ is also definedf_ {max} $ as the maximum value that fluorescence can reach after photoblanqueo, and is given by: \[ f_ {max} = f_ {min}+\ alpha (1-f_ {min}). \]

It can be seen that the function $ f (t) $ is defined in the time interval $ t  in [t_0,  infty) $.Similarly, the function $ f{{ab}} (t) $ to represent the fluorescence recovery curve after photoblanqueo is defined, which is defined in the time interval $ t  in [0, infty) $:

\[ f^{^{ab}} (t) = f_ {min}+\ alpha \, (1-f_ {min}) \, p (t | \ theta). \]

In the [Appendix] (#mod) of this document you can find more information about the construction of the model.In order for the user to make the parametric adjustment, for the subsequent data analysis, their data will only have to choose the probability model, $ P $, more appropriate.Through the Newfit function it is possiblethe ranges of values for these parameters.For more details go to [Newfit] (#Newfit).

{r evali = false} Exp <-newfit ("Exponential", Pexp, "Rate", List (C (0.1))) GAM <-Newfit ("Gamma", Pgamma, C ("Shape", "Rate"), List (C (0.5), C (0.5))))) Wei <-newfit ("Weibull", Pweibull, C ("Shape", "Scale"), List (C (0.5), C (0.2000))))))

One of the most important criteria to choose between different probability models is through the average quadratic error, those models that have less error must be mostly preferred.The average quadratic error is given by the following expression: $$ e_i =  fraud Where $  {f_1, .., f_n } $ is a group of fluorescence data and $  {t_1, t_2,  cdots, t_ {m_i} } $ are all those higher values than quantified photoblanqueo for $ f_i$.The comparefit compare the average quadratic error of different probability models adjusted to a data group, through a Q-Q graph and the error histogram of each of the models.The function receives as parameters the data group in question, a list of the models that are required to compare, as well as a series of parameters that allow customizing the graph.For more details go to [CompaRefit] (#comparefit).

<a name=“refcomParefit¸

{r evali = false} comparefit (b, fit = l (exp, gam, wei), col.lines = c ("network", "yellow"), lty.lines = c (2,1), lwd.lines = 2, lwd.mean= 2)

{r out.width = "85%", fig.align = 'center', echo = fals} Graph ("IMG/004.jpg")#>>> <<<

{r evali = false} comparefit (c, fit = l (exp, gam, wei), col.lines = c ("network", "yellow"), lty.lines = c (2,1), lwd.lines = 2, lwd.mean= 2)

{r out.width = "85%", fig.align = 'center', echo = fals} Graph ("IMG/005.jpg")#>>> <<<

For more information about the choice of a good probability model go to [Appendix] (#prob).

Fit a parametric model

For this case, in particular, the Weibull model has better results, so the Wei function is used to make the corresponding setting of the data, theWei function, applied in a data groupSpecific, it returns a list with the information obtained by the parametric adjustment, as well as the estimation of the Fluorescence Recovery Function $ F (T) $, among other relevant data, for more details to go to [Newfit] (#Newfit).

To carry out the parametric adjustment graph of fluorescence recovery, the Plotfit function is used, which receives as parameters, first of all, the data groups for adjusting and subsequently the probability model that has been chosen for each groupof data, between optional parameters that allow customizing and formatting to each graph, go to [Plotfit] (#plotfit) to know more.If the chosen probability model is the same for all data groups, it is enough to specify it once as seen below:

{r evali = false} plotfit (b, c, fit = wei, plot.lines = t)

{r out.width = "75%", fig.align = 'center', echo = fals} graph ("IMG/006.jpg")#>>> <<<

{r evali = false} plotfit (b, c, fit = wei, plot.shadow = t, plot.mean = t, alp.shadow = 0.2, ylim = c (0.2, 1), xDigits = 0)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/007.jpg")#>>> <<<

With the Plotfit function you can graph future estimates, of the fluorescence recovery curve, just by modifying the range of the graph.The graphs obtained by the functions Plotrecover andPlotfit can be stacked by changing the optional parameter new.plot aFalse.

{r evali = false} plotfit (B, fit = wei, plot.shadow = t, alp.shadow = 0.3, xlim = c (0.500), ylim = c (0.2, 1)) Plotrecover (B, AB = T, Plot.Lines = T, New.Lot = F)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/008.jpg")#>>> <<<

Another use for the Plotfit function is to make a visual comparison between two or more probability models about the same data group. {r evali = false} Plotrecover (B, plot.shadow = t, ylim = c (0.2, 1.2), xDigits = 0, lwd.border = 1, col = "#808080") plotfit (B, B, Fit = L (Wei, Exp), plot.lines = t, new.ploot = f, Displacement = T, Col = C ("Blue2", "Red2"))

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/009.jpg")#>>> <<<

Compare data sets

Conventional Analysis

Through the compareparam it is possible to compare two groups of data through the variables associated with the adjustment of the parametric model.The parameters that this function receives are the two groups of data, the probability model that adjusts to each data group, the variable that you want to compare, among other values that allow customizing the graph.To know more about going to [Compaleparam] (#compareparam).The names of the variables can be obtained as follows:

{r evali = false} COLNAMES (WEI (B) $ TABLE)

{r echo = false} Names <-C ("Shape", "Scale", "Alpha", "Fmax", "UF", "MF", "Error") Names

The compareparam function performs a Q-Q graph of the chosen variable, changing thenew.plot = fals' parameter is possible to stack the graphics.The details of the $ t \ mbox {-} Student $ for the difference in $ 95 \%confidence are obtained by changing thereturn = Trueparameter (consequently, the graph will be omitted), the level of trustand the alternative hypothesis can be modified by thealternativeandconf.level` parameters respectively, for more details go to [compareparam] (#compareparam).

{r evali = false} compareparam (b, c, fit = wei, param = "shape")

{r out.width = "65%", fig.align = 'center', echo = fals} Graph ("IMG/010.jpg")#>>> <<<

In this way it is possible to carry out a conventional analysis of the recovery of fluorescence, that is, compare the motionless fraction (UF) and the mobile fraction (MF).Remember that \[ UF = \ fraud {1-f_ {max}} {1-f_ {min}} \] \[ mf = \ fraud {f_ {max} -f_ {min}} {1-f_ {min}} \] \[ UF+MF = 1 \] {r evali = false} compareparam (b, c, fit = wei, param = "uf", xlim = c (0.1), ylim = c (0.1), lty.lines = c (2,1), col.lines = c("White", "Red"), Lwd.Lines = 2) Compaperam (B, C, Fit = Wei, Param = "mf", New.pLot = F, Lwd.lines = 2)

{r out.width = "65%", fig.align = 'center', echo = fals} Graph ("IMG/011.jpg")#>>> <<<

{r} compareparam (b, c, fit = wei, param = "uf", return = t)#>>> <<<

{r} compareparam (b, c, fit = wei, param = "mf", return = t)#>>> <<<

Also, with the compareparam it is possiblecomparefit` view [previously] (#refcomparefit).

{r evali = false} compareparam (b, b, fit = l (exp, wei), param = "error", col.lines = c ("network", "yellow"), lwd.lines = 2, lty.lines = c (2,1), Ydigits = 2, xDigits = 2)

{r out.width = "65%", fig.align = 'center', echo = fals} Graph ("IMG/012.jpg")#>>> <<<

{r} compareparam (b, b, fit = l (exp, wei), param = "error", return = t)#>>> <<<

Mean Curve Analysis

The analysis of the average curve is to evaluate the average behavior of the recovery of fluorescence over time, the average curve is given by:

$$  overline f (t) =  fraud

Where $ N is the size of the data set in question and $ f^{ab} _i $ is the fluorescence recovery curve after photoblanqueo associated with the quantification of fluorescence $ f_i $.

{r evali = false} plotfit (B, fit = wei, plot.lines = t, plot.mean = t, col.mean = "purple", lwd.mean = 2, xDigits = 0, ydigits = 2, alp.lines = 0.5)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/013.jpg")#>>> <<<

The Comparemean allows you to contrast the average curves of two groups of data through a $ t  mbox {-} Student $ test for the average difference applied continuously in a period of time.The function receives as parameters to the data groups to be compared, the probability model that adjusts to the data, among other values that allow customizing the graph.

The chart that returns represents the $ P  Mbox {-} value $ t  mbox {-} Student $, the reference line indicates the level of significance.Changing the return = True parameter the details of the test stored in a list (omitting the realization of the graph) are obtained, the level of trust and the alternative hypothesis can be modified by the parametersalternativeandconf.levelrespectively, for more details go to [compare me] (#comparemean).

{r evali = false} Compare me (B, C, Fit = Wei, Lty.Lines = C (2,1), Col.Lines = C ("Red", "Purple"), Ydigits = 2)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/014.jpg")#>>> <<<

Changing the P.Value = false parameter will calculate the difference in means between the two data groups, the reference line will be located at zero.In this case when changing the return = True parameter, a vector is obtained with the difference of stockings between both curves.

{r evali = false} Compare me (B, C, Fit = Wei, P.Value = F, Lty.Lines = C (2,1), Col.Lines = C ("network", "magenta"), Ydigits = 3)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/015.jpg")#>>> <<<

Simulation

The implementation of simulation methods for the analysis of fluorescence recovery is one of the main contributions of this work.Simulation allows the size of a sample to be increased without altering its centered or dispersion trend measures, this is especially useful for cases where there is no sufficiently large sample size, remember that hypothesis tests that depend on processeslimit are particularly sensitive to the sample size.On the other hand, the simulation process is feeded with an adequate choice of the probability model, this is explained more [ahead] (#prob).

The simulation of the fluorescence recovery model $ f (t) is achieved thanks to the simulation of the parameters $  theta $ of the probability model $ P (t |  theta) $, go to the [Appendix] (#sim) to know more.The Simfit function allows simulating the data adjusted to a probability model, receives as a mandatory parameter a data group adjusted to a probability model and as optional parameters the size of the simulated sample and a simulation seed, for more detailsOn the simulation seed go to [Appendix] (#Seed).

In the case of the Weibull adjustment, the simulation of the data is carried out as follows Simfit (Wei (b)) and Simfit (Wei (c)), for more specifications on the data that this IR [Simfit] function (#Simfit) shows.On the other hand, the functions Plotfit,`We can replicate the graphs made above now with simulated data: {r evali = false} plotfit (b, c, fit = wei, simulated = t, plot.lines = t)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/016.jpg")#>>> <<<

{r evali = false} plotfit (b, c, fit = wei, simulated = t, plot.shadow = t, plot.mean = t, alp.shadow = 0.2, ylim = c (0.2, 1), xDigits = 0)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/017.jpg")#>>> <<<

{r evali = false} plotfit (B, fit = wei, simulated = t, plot.shadow = t, alp.shadow = 0.3, xlim = c (0.500), ylim = c (0.2, 1)) Plotrecover (B, AB = T, Plot.Lines = T, New.Lot = F)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/018.jpg")#>>> <<<

{r evali = false} Plotrecover (B, AB = T, Plot.Shadow = T, Ylim = C (0.2, 1.2), xDigits = 0, Lwd.border = 1, Col = "#808080") plotfit (b, b, fit = l (Wei, exp), simulated = t, plot.lines = t, new.ploot = f, displacement = t, col = c ("blue2", "red2"))

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/019.jpg")#>>> <<<

{r evali = false} compareparam (b, c, fit = wei, simulated = t, param = "shape")

{r out.width = "65%", fig.align = 'center', echo = fals} graph ("IMG/020.jpg")#>>> <<<

{r evali = false} compareparam (b, c, fit = wei, param = "uf", simulated = t, xim = c (0.1), ylim = c (0.1), lty.lines = c (2,1), col.Lines = C ("White", "Red"), Lwd.lines = 2) compareparam (b, c, fit = wei, param = "mf", simulated = t, new.ploot = f, lwd.lines = 2)

{r out.width = "65%", fig.align = 'center', echo = fals} Graph ("IMG/021.jpg")#>>> <<<

{r evali = false} compareparam (b, c, fit = wei, simulated = t, param = "uf", return = t)

{r echo = false} compareparam (b, c, fit = Wei, simulated = t, param = "uf", return = t, seed = 19880)#>>> <<<<

{r evali = false} compareparam (b, c, fit = wei, simulated = t, param = "mf", return = t)

{r echo = false} compareparam (b, c, fit = Wei, simulated = t, param = "mf", return = t, seed = 19880)#>>> <<<

{r evali = false} plotfit (b, fit = wei, simulated = t, plot.lines = t, plot.mean = t, col.mean = "purple", lwd.mean = 2, xdigits = 0, ydigits = 2, alp.lines =0.5)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/022.jpg")#>>> <<<

{r evali = false} Compare me (B, C, Fit = Wei, Simulated = T, Lty.Lines = C (2,1), Col.Lines = C ("Red", "Purple"), Ydigits = 2)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/023.jpg")#>>> <<<

{r evali = false} Compare me (B, C, Fit = Wei, Simulated = T, P.Value = F, Lty.Lines = C (2,1), Col.Lines = C ("Red", "Magenta"), Ydigits = 3)

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/024.jpg")#>>> <<<

Appendix

The Fluorescence Recovery Model

The quantification of fluorescence in the process of the frap technique follows a specific recovery pattern.Initially, fluorescence remains constant, but at the time of photoblanqueo (also known as $ t_0 $), the intensity of fluorescence decreases to a minimum value called $ F_ {min} \(.From that point, a gradual process of fluorescence recovery that is characterized by two fundamental conditions begins: first, recovery does not decrease as time elapses, and secondly, fluorescence reaches a maximum limit(\) f_ {max} $) that cannot exceed the initial value before photoblanqueo.This evolution is represented graphically for a better understanding of the process.

{r out.width = "75%", fig.align = 'center', echo = fals} Graph ("IMG/025.jpg")#>>> <<<

In that sense, the proposed model for the recovery of fluorescence must comply with the above characteristics, the general model for the recovery of fluorescence after photoblanqueo is as follows:

\[ f (t) = f_ {min}+\ alpha \, (1-f_ {min}) \, p (t-t_0 | \ theta) \]

Where $ P $ is a continuous accumulated distribution function (CDF), parameterized for $  theta $.

Observations
  • The function $ f (t) $ is defined in the $ [t_0,  infty) interval

  • The value $ f_ {max} $ is given by \[ f_ {max} = \ lim_ {t \ to \ infty} f (t) \]

  • The $  Alpha $ value is limited by values \[ \ alpha \ in [0.1] \]

  • The accumulated distribution function $ P $ must be associated with a random variable that with support for $ (0,  infty) $, remember that the CDF is defined as follows:

    \[ P (T | \ Theta) = \ int_0^td (x | \ theta) \, \ mbox {d} x \] where $ D $ is a function of parametric density.

Similarly, the function $ f{{ab}} (t) $ to represent the fluorescence recovery curve after photoblanqueo is defined, which is defined in the time interval $ t  in [0, infty) $:

\[ f^{^{ab}} (t) = f_ {min}+\ alpha \, (1-f_ {min}) \, p (t | \ theta). \]


** Let’s prove that $ F $ meets the characteristics of fluorescence recovery after photoblanqueo: **
  • ** $ f (t_0) = f_ {min} $ **
  • Is evaluated

    \[ \ Begin {alledned} F (t_0) & = f_ {min}+\ alpha \, (1-f_ {min}) \, p (t_0-t_0 | \ theta) \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \, p (0 | \ theta) \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \ int_0^0d (x | \ theta) \, \ mbox {d} x \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \, (0) \\ & = f_ {min} \ end {alledned} \] \[ \ therefore f (t_0) = f_ {min} \]

  • ** $ f (t) $ is not decreasing **
  • Consider $ t_1, t_2  in  mathbb r^+$ such that $ t_1  leq t_2 $, then

    \[ \ Begin {alledned} t_1-t_0 \ leq & \; t_2-t_0 \\ \ Righttarrow p (t_1-t_0 | \ theta) \ leq & \; p (t_2-t_0 | \ theta) \\ f_ {min}+\ alpha \, (1-f_ {min}) \, p (t_1-t_0 | \ theta) \ leq & \; f_ {min}+\ alpha \, (1-f_ {min})\, P (t_2-t_0 | \ theta) \ end {alledned} \] \[ \ therefore f (t_1) \ leq f (t_2) \]

    The above proves that the parametric model $ F $ is not decreasing over time.

  • ** $ f_ {max} = f_ {min}+ alpha , (1-f_ {min}) $ and $ f_ {max}  in [f_ {min}, 1] $ **

    The $ f (t) $ limit is calculated when $ t $ tends to infinity:

    \[ \ Begin {alledned} f_ {max} = \ lim_ {t \ to \ infty} f (t) & = \ lim_ {t \ to \ infty} f_ {min}+\ alpha \, (1-f_ {min}) \, p (t-t_0 | \ theta) \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \ lim_ {t \ to \ infty} \, p (t-t_0 | \ theta) \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \ lim_ {t \ to \ infty} \ int_0^{t-t_0} d (x | \ theta) \, \ mbox {d}x \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \ int_0^{\ infty} d (x | \ theta) \, \ mbox {d} x \\ & = f_ {min}+\ alpha \, (1-f_ {min}) \, (1) \ end {alledned} \]

    \[ \ therefore f_ {max} = f_ {min}+\ alpha \, (1-f_ {min}) \] On the other hand you have to $  alpha  in [0.1] $, then

    \[ \ Begin {alledned} & 0 \ leq \ alpha \ leq 1 \\ \ Righttarrow & 0 \ leq \ alpha \, (1-f_ {min}) \ leq 1-f_ {min} \\ \ Righttarrow & f_ {min} \ leq f_ {min}+\ alpha \, (1-f_ {min}) \ leq f_ {min}+1-f_ {min} \\ \ Righttarrow & f_ {min} \ leq f_ {min}+\ alpha \, (1-f_ {min}) \ leq 1 \\ \ Righttarrow & f_ {min} \ leq f_ {max} \ leq 1 \\ \ end {alledned} \] \[ \ therefore f_ {max} \ in [f_ {min}, 1] \]

    Given a set of fluorescence data $ F $ and a accumulated distribution function $ P ( bullet |  theta) $, then the parameters $ ( alpha,  theta) $ are estimated by means of the method of minimum squares, whichIt consists of minimizing the average quadratic error between the curves $ F $ and $ F $, the function of the average quadratic error is as follows:

    \[ \ Begin {alledned} e (\ alpha, \ theta) & = \ sum_ {j = 1}^m \ left [f (t_j) -f (t_j) \ right]^2 \\ & = \ sum_ {J = 1}^m \ left [f (t_j) -f_ {min}-\ alpha \, (1-f_ {min}) \, p (t_j-t_0 | \ theta) \ right]^2 \ end {Aligned} \] where $  {t_1, t_2,  cdots, t_m } $ are all those over $ t_0 $ quantified for $ f $.

    <a name=“prob Today

    Cosidere el conjunto de datos de cuantificación de fluorescencia denotados por \(\{f_1,f_2,...,f_n\}\) y el conjunto de curvas de FRAP asociadas \(\{F^{^{AB}}_1,F^{^{AB}}_2,...,F^{^{AB}}_n\}\), el proceso de simulación permite generar un conjunto de \(N_{sim}\) nuevas curvas de FRAP \(\{\mathcal F^{^{AB}}_1,\mathcal F^{^{AB}}_2,...,\mathcal F^{^{AB}}_{N_{sim}}\}\). Cada curva \(\mathcal F^{^{AB}}_j\) no se encuentra directamente asociada a ningún dato de florescencia \(f_i\), en cambio, \(\mathcal F^{^{AB}}_j\) es producto de un proceso se simulación estocastica sobre el conjunto de parámetros \(\{(\alpha_1, \Theta_1),(\alpha_2, \Theta_2),\cdots,(\alpha_n, \Theta_n)\}\), donde \((\alpha_i, \Theta_i)\) son aquellos valores que se obtuvieron por medio de la optimización por mínimos cuadrados entre \(f_i\) y \(F_i\).

    De manera más específica, el proceso de simulación de las curvas de FRAP es el siguiente:

    Por medio de la función de distribución acumulada empírica (vista en la sección anterior de este apéndice) de \(\{\Theta_1,\Theta_2,\cdots,\Theta_n\}\) se generan los valores \(\{ \Theta^{sim}_1,\Theta^{sim}_2,\cdots,\Theta^{sim}_m\}\), es decir:

    \[\Theta_j^{sim}=\widehat{\mathbb F}_{\Theta_1,\Theta_2,\cdots,\Theta_n}^{-1}(U_j)\]

    \[\mathcal F^{^{AB}}_j(t)=f_{min}+\alpha_j^{sim}\,(1-f_{min})\,p(t|\Theta_j^{sim}).\]

  • Choosing a Probability Model

    The accumulated distribution function $ P (T |  Theta) is the basis for building the parametric model of fluorescence recovery $ F (t |  theta) $.The choice of the $ P $ function is at the free criteria of the user, however, it is essential that $ P $ has a support for $ (0,  infty) $, another aspect that the user must be in charge is the allocation of the intervalsWhere the parameters $  theta $ takes values, this is achieved through the Newfit function.


    Example:

    Assume that the user has decided \[ P (T | \, \ Mbox {Shape}, \ mbox {Scale}) = 1- \ left (\ fraud{Shape}} \] \[ t> 0, \; \; \ mbox {scale}> 0 \; \; \ & \; \; \ mbox {Shape}> 0 \] The Pareto accumulated distribution function is implemented and its associated parametric adjustment is declared:

    `` {r evali = false} Pareto <- Function (T, Shape, Scale) { PPAR <- null for (t in t) PPAR <- C (PPAR, 1- (Scale/(T+Scale))^Shape) PPAR }

    Par <- Newfit (“Pareto”, Pareto, C (“Shape”, “Scale”), List (C (0, A), C (0, b))))) ``

    The previous code establishes that $  mbox {Shape}  in (0, a) $ and $  mbox {Scale}  in (0, b) $.After adjusting the Par model to a data group, the user must verify that theShape and Scale values are completely contained inside the intervals $ (0, a) $ and $ (0, B) $ respectively, otherwise, you will have to modify the values of $ to $ and/or $ B $ and repeat the procedure.The above is achieved by a visual inspection of the variables returned by the adjustment: the codes tor (b) $ Shape andpair (b) $ table $ Scale must be executed and inspect the results, where bIt is a FRAP data set obtained through theNewdataFrap function.


    The functions created by Newfit have the purpose of finding the best values $  theta $ such that minimize the quadratic error between the $ F model (t |  theta) $ and the real data of recovery of fluorescence.Therefore, the main criteria for choosing the most appropriate $ P $ p $ model should be: prefer the model that produces the slightest average quadratic error, this is achieved, as previously seen, through the comparefit function.

    {r evali = false} comparefit (b, fit = l (exp, gam, wei, par), col.lines = c ("network", "yellow"), lty.lines = c (2,1), lwd.lines = 2, lwd.mean = 2)

    {r out.width = "95%", fig.align = 'center', echo = false} graph ("IMG/026.jpg")#>>> <<<

    On the other hand, a second criterion to evaluate the viability of a probability model $ P $ is seeing how the simulations of $ f $ behave.If there are discrepancies between real fluorescence data and simulations of $ F $ then the most reasonable is discarding the $ P $ model.Since this would imply that there is no causal relationship between the $  theta $ parameters and fluorescence recovery data and, as will be seen in the following appendix, the simulations of $ F_ {max} $ are particularly sensitive to variationsof $  Theta $.

    `` {r evali = false} plotfit (b, b, fit = l (null, exp), cabbage), lwd.mean = 2, plot.shadow = c (t, f), lwd.border = 1, alp.border = 0.4, alp.shadow = 0.3, ylim = c (0.2, 1), xDigits = 0,Simulated = T, Seed = 1992, Main = “Exponential simulation”, Cex.Main = 1.5)

    plotfit (b, b, fit = l (null, gam), col = c (“#916f91”, “#4db34d”), plot.lines = c (f, t), plot.mean = c (t, f), lwd.mean = 2, plot.shadow = c (t, f), lwd.border = 1, alp.border = 0.4, alp.shadow = 0.3, ylim = c (0.2, 1), xDigits = 0,simulated = t, Seed = 1992, main = “gamma simulation”, cex.main = 1.5)

    plotfit (b, b, fit = l (null, wei), col = c (“#916f91”, “#664dff”), plot), lwd.mean = 2, plot.shadow = c (t, f), lwd.border = 1, alp.border = 0.4, alp.shadow = 0.3, ylim = c (0.2, 1), xDigits = 0,simulated = t, Seed = 1992, main = “weibull simulation”, cex.main = 1.5)

    plotfit (b, b, fit = l (null, par), col = c (“#916f91”, “#b34db3”), plot.lines = c (f, t), plot.mean = c (t, f), lwd.mean = 2, plot.shadow = c (t, f), lwd.border = 1, alp.border = 0.4, alp.shadow = 0.3, ylim = c (0.2, 1), xDigits = 0,Simulated = T, Seed = 1992, Main = “Pareto Simulation”, Cex.Main = 1.5) {r out.width = “70%”, fig.align = ‘center’, echo = false} Graph (“IMG/027.jpg”)#>>> <<< ``

    <a name=¹Simthe¸

    Stochastic simulation theory

    Stochastic simulation is a process by which it is intended to reproduce the behavior of a random variable, the base of the simulation is followed by the following theorem:

    Let $ x $ is a random variable and $  mathbb f_x $ its accumulated distribution function, is $ US a random variable with $  mbox  mbox {uniform} (0.1) $, then the random variable $  mathbb f f^{-1} _x (u) $ has the same distribution as $ x $, that is:

    \[ \ mathbb f_x = \ mathbb f _ {\ mathbb f^{-1} _x (u)} \]


    ** Proof: **

      \[ \ Begin {alledned} \ Mathbb f _ {\ mathbb f^{-1} _x (u)} & = \ mathbb p \ left [\ mathbb f^{-1} _x (u) \ leq t \ right] = \ mathbb p \ left [\ mathbb f_x \ left (\ mathbb f^{-1} _x (u) \ right) \ leq \ mathbb f_x \ left (t \ right) \ right] \\ & = \ mathbb p \ left [u \ leq \ mathbb f_x \ left (t \ right) \ right] = \ int_0^{\ mathbb f_x \ left (t \ right)} f_u (u) \, \ mbox {d} u = \ int_0^{\ mathbb f_x \ left (t \ right)} 1 \, \ mbox {d} u \\ & = \ left.u \ right | _0^{\ mathbb f_x \ left (t \ right)} = {\ mathbb f_x \ left (t \ right)}-0 = {\ mathbb f_x \ left (t \ right)} \ end {alledned} \] \[ \ therefore {\ mathbb f_x \ left (t \ right)} = \ mathbb f _ {\ mathbb f^{-1} _x (u)} \]

      Note that at $ U $ is a uniform variable, you have to $ f_u (u) = 1, ; ;0 <u <1 \(.(\) F_U $ is the density function of $ USA)


    The previous theorem allows to simulate any random variable $ x $ provided that its accumulated distribution function $ F_X $ is known.Be $  {u_1, u_2,  cdots, u_n } $ a random sample of observed values of the random variable $  mbox {uniform} (0.1) $, then $  { mathbb f_x^{-1}(u_1),  Mathbb f_x^{-1} (u_2),  cdots,  mathbb f_x^{-1} (u_n) } $ is a sample of simulated values of the variable $ x $.In computational terms, to carry out the simulation simulation process, the generation of a uniform random sample is carried out by means of [generation of pseudo -free numbers] (https://en.wikipedia.org/wiki/pseudorandom_number_generator).

    {r out.width = "70%", fig.align = 'center', echo = false} graph.html ("IMG/028.gif", "IMG/028.jpg")#>>> <<<

    There will be situations in which it is necessaryUse the empirical accumulated distribution function (ECDF), which is defined as follows:

    \[ \ widehat {\ mathbb f} _ {x_1, x_2, \ cdots, x_n} (t) = \ fraud {1} {n} \ sum_ {i = 1}^n \ mathbb {i} _ {x_i \leq t} \]

    where $  mathbb {i} _ {x_i  leq t} =  left  lbace  begin {alled} 1, ;x_i  leq t \ 0, ;x_i> t  end {alledned}  right.

    {r out.width = "70%", fig.align = 'center', echo = false} graph.html ("IMG/029.gif", "IMG/029.jpg")#>>> <<<

    <a name=“sim now

    Simulation of A Frap Curves

    Cosidere the fluorescence quantification data set denoted for $  {f_1, f_2, …, f_n } $ and the set of associated frap curves $  {f{{ab}} _ 1, f{{Ab}} _ 2, …, f{{ab}} _ n } $, the simulation process allows to generate a set of $ n_ {sim} $ new curves of frap $  { mathcal f{{Ab}} _ 1,  Mathcal f{{ab}} _ 2, …,  Mathcal f{{ab}} _ {n_ {sim}} } $.Each curve $  Mathcal f{{ab}} _ j $ is not directly associated with any Florecence data $ f_i $, on the other hand, $  mathcal f{{ab}} _ j $ is the product of a processStochastic simulation on the parameter set $  {( alpha_1,  theta_1), ( alpha_2,  theta_2),  cdots, ( alpha_n,  theta_n) } $, where $ ( alpha_i,  theta_i) is simulated on the parameter set.$ are those values that were obtained through the optimization for minimum squares between $ F_i $ and $ F_i $.

    In a more specific way, the process of simulation of frap curves is as follows:

    Through the empirical accumulated distribution function (seen in the previous section of this appendix) of $  { theta_1,  theta_2,  cdots,  theta_n } $ the values $   { theta^{sim}_1,  theta^{sim} _2,  cdots,  theta^{sim} _m } $, that is:

    \[ \ theta_j^{sim} = \ widehat {\ mathbb f} _ {\ theta_1, \ theta_2, \ cdots, \ theta_n}^{-1} (u_j) \]

    \[ \ Mathcal f^{^{ab}} _ j (t) = f_ {min}+\ alpha_j^{sim} \, (1-f_ {min}) \, p (t | \ theta_j^{sim}). \]

    {r out.width = "65%", fig.align = 'center', echo = fals} graph.html ("IMG/030.gif", "IMG/030.jpg")#>>> <<<

    fraping-doc

    newDataFrap

    # Function: newDataFrap
    #
    # Description: Create a new instance of the "frapclass" class.
    #
    # Parameters:
    #   - name: Name of the FRAP object.
    #   - bleach: Percentage of sample bleaching.
    #
    # Returns: An instance of the "frapclass" class.
    #
    # Usage:
    #   frap_obj <- newDataFrap(name, bleach)
    A <- newDataFrap("Neurites", 80)
    B <- newDataFrap("Secondary.Neurites", 80)
    C <- newDataFrap("Dendrites", 80)

    plotRecover

    # Function: plotRecover
    #
    # Description: Plot the fluorescence recovery curves.
    #
    # Parameters:
    #   - ...: Additional parameters for the plot function.
    #   - index: Index or indices of the FRAP objects to plot.
    #   - type: Type of recovery curve to plot (default: "RCB").
    #   - area: Whether to include area normalization in the plot (default: TRUE).
    #   - stand: Whether to standardize the recovery curve (default: TRUE).
    #   - AB: Whether to include only the recovery phase of the curve (default: FALSE).
    #   - new.plot: Whether to create a new plot (default: TRUE).
    #   - plot.lines: Whether to plot lines (default: FALSE).
    #   - plot.points: Whether to plot points (default: FALSE).
    #   - plot.shadow: Whether to plot shadowed areas (default: FALSE).
    #   - plot.mean: Whether to plot the mean curve (default: FALSE).
    #   - col: Color of the curves (default: NULL).
    #   - getGroup: Whether to return the group information (default: FALSE).
    #
    # Usage:
    #   plotRecover(..., index = NA, type = "RCB", area = TRUE, stand = TRUE, AB = FALSE,
    #               new.plot = TRUE, plot.lines = FALSE, plot.points = FALSE, plot.shadow = FALSE,
    #               plot.mean = FALSE, col = NULL, getGroup = FALSE)
    # Example 1: Plotting fluorescence recovery curves for FRAP objects A, B, and C.
    plotRecover(A, B, C, plot.lines = TRUE, col = c("blue", "red", "green"))

    # Example 2: Plotting specific indices of recovery curves.
    plotRecover(A, B, C, index = c(1, 3), plot.points = TRUE, col = "purple")

    # Example 3: Customizing the plot with shadowed areas and mean curve.
    plotRecover(A, B, C, plot.lines = TRUE, plot.shadow = TRUE, plot.mean = TRUE)

    # Example 4: Plotting standardized recovery curves without area normalization.
    plotRecover(A, B, C, area = FALSE, stand = TRUE, plot.lines = TRUE, col = "orange")

    # Example 5: Plotting recovery curves from different FRAP objects in the same plot.
    plotRecover(A, Exp, plot.lines = TRUE, col = "blue")
    plotRecover(B, Gam, new.plot = FALSE, plot.lines = TRUE, col = "red")
    plotRecover(C, Wei, new.plot = FALSE, plot.lines = TRUE, col = "green")

    newFit

    # Function: newFit
    #
    # Description: Create a new instance of the "fitclass" class for FRAP data fitting.
    #
    # Parameters:
    #   - name: Name of the fitting model.
    #   - fun: Fitting function.
    #   - param: Names of the fitting parameters.
    #   - interval: Interval for each fitting parameter.
    #
    # Usage:
    #   newFit(name, fun, param, interval)
    # Example 1: Creating a new fitting model using the Exponential function.
    Exp <- newFit("Exponential", pexp, "rate", list(c(0, 1)))
    
    # Example 2: Creating a new fitting model using the Gamma function.
    Gam <- newFit("Gamma", pgamma, c("shape", "rate"), list(c(0, 5), c(0, 5)))
    
    # Example 3: Creating a new fitting model using the Weibull function.
    Wei <- newFit("Weibull", pweibull, c("shape", "scale"), list(c(0, 5), c(0, 2000)))
    
    # Example 4: Creating a new fitting model with custom parameters and intervals.
    fit_custom <- newFit("Custom", myfitfunction, c("param1", "param2", "param3"),
        list(c(0, 10), c(-1, 1), c(0, 100)))

    compareFit

    # Function: compareFit
    #
    # Description: Compare the goodness of fit between data and multiple fits.
    #
    # Parameters:
    #   - data: Data to compare (numeric vector or data frame).
    #   - fit: List of fits to compare (list of numeric vectors or data frames).
    #   - col.lines: Color palette for the fit lines (default: NULL).
    #   - lty.lines: Line type for the fit lines (default: 1).
    #   - lwd.lines: Line width for the fit lines (default: 1).
    #   - lwd.mean: Line width for the mean fit line (default: 1).
    #   - digits: Number of digits to round the fit statistics (default: 4).
    #   - ...: Additional parameters for the plot function.
    #
    # Usage:
    #   compareFit(data, fit, col.lines = NULL, lty.lines = 1, lwd.lines = 1, lwd.mean = 1,
    #              digits = 4, ...)
    # Example 1: Comparing the goodness of fit for different models using pre-loaded data
    compareFit(B, list(Exp, Wei), col.lines = c("red", "yellow"), lty.lines = c(2, 1),
               lwd.lines = 2, lwd.mean = 2)

    # Example 2: Comparing the goodness of fit for different models with custom colors and line types
    compareFit(B, list(Exp, Gam, Wei), col.lines = c("blue", "green", "purple"),
               lty.lines = c(1, 3, 2), lwd.lines = 2, lwd.mean = 2)

    plotFit

    # Function: plotFit
    #
    # Description: Plot the fit of fluorescence recovery curves.
    #
    # Parameters:
    #   - ...: Additional parameters for the plot function.
    #   - fit: Fit objects obtained from the newFit function.
    #   - index: Index or indices of the fit objects to plot.
    #   - type: Type of recovery curve to plot (default: "RCB").
    #   - area: Whether to include area normalization in the plot (default: TRUE).
    #   - stand: Whether to standardize the recovery curve (default: TRUE).
    #   - simulated: Whether to include simulated recovery curves (default: FALSE).
    #   - Nsim: Number of simulated curves to generate (default: 50).
    #   - seed: Seed value for reproducibility of simulated curves (default: NA).
    #   - npoints: Number of points to generate in simulated curves (default: 100).
    #   - displacement: Whether to add random displacement to simulated curves (default: FALSE).
    #   - new.plot: Whether to create a new plot (default: TRUE).
    #   - plot.lines: Whether to plot lines (default: FALSE).
    #   - plot.points: Whether to plot points (default: FALSE).
    #   - plot.shadow: Whether to plot shadowed areas (default: FALSE).
    #   - plot.mean: Whether to plot the mean curve (default: FALSE).
    #   - col: Color of the curves (default: NULL).
    #
    # Usage:
    #   plotFit(..., fit, index = NA, type = "RCB", area = TRUE, stand = TRUE, simulated = FALSE,
    #           Nsim = 50, seed = NA, npoints = 100, displacement = FALSE,
    #           new.plot = TRUE, plot.lines = FALSE, plot.points = FALSE, plot.shadow = FALSE,
    #           plot.mean = FALSE, col = NULL)
    # Example 1: Plotting the fit of fluorescence recovery curves for objects B and C with Exp, Wei, and Gam fits
    plotFit(B, C, fit = Exp, plot.lines = TRUE, col = c("blue", "red", "green"), ylim = c(0.2, 1), xdigits = 0)

    # Example 2: Plotting the fit of fluorescence recovery curves for object B with Exp, Wei, and Gam fits
    plotFit(B, fit = Gam, plot.lines = TRUE, col = c("blue", "red", "green"), ylim = c(0.2, 1), xdigits = 0)

    # Example 3: Plotting the fit of fluorescence recovery curves for objects B and C with Exp, Wei, and Gam fits and points
    plotFit(B, C, fit = c(Exp, Gam), plot.lines = TRUE, plot.points = TRUE, col = c("blue", "red", "green"), ylim = c(0.2, 1), xdigits = 0)

    # Example 4: Plotting the fit of fluorescence recovery curves for object B with Exp, Wei, and Gam fits and shadowed areas
    plotFit(C, fit = Wei, plot.lines = TRUE, plot.shadow = TRUE, col = c("blue", "red", "green"), ylim = c(0.2, 1), xdigits = 0)

    compareParam

    # Function: compareParam
    #
    # Description: Compare parameter estimates between two datasets based on the fit results.
    #
    # Parameters:
    #   - data1: First dataset of fluorescence recovery curves.
    #   - data2: Second dataset of fluorescence recovery curves.
    #   - fit: Fit object containing the results of fitting the data.
    #   - param: Parameter to compare between the datasets.
    #   - type: Type of recovery curve to consider (default: "RCB").
    #   - area: Whether to include area normalization in the comparison (default: TRUE).
    #   - stand: Whether to standardize the recovery curves (default: TRUE).
    #   - simulated: Whether to use simulated data for the comparison (default: FALSE).
    #   - Nsim: Number of simulated datasets to generate (default: 50).
    #   - seed: Seed for random number generation (default: NA).
    #   - conf.level: Confidence level for the confidence interval (default: 0.95).
    #   - alternative: Type of alternative hypothesis in the statistical test (default: "two.sided").
    #   - return: Whether to return the comparison results (default: FALSE).
    #   - new.plot: Whether to create a new plot (default: TRUE).
    #   - plot.lines: Whether to plot lines in the comparison plot (default: TRUE).
    #   - plot.points: Whether to plot points in the comparison plot (default: FALSE).
    #   - col: Color of the curves in the comparison plot (default: NULL).
    #   - ...: Additional parameters for the comparison plot.
    #
    # Usage:
    #   compareParam(data1, data2, fit, param, type = "RCB", area = TRUE, stand = TRUE,
    #                simulated = FALSE, Nsim = 50, seed = NA, conf.level = 0.95,
    #                alternative = "two.sided", return = FALSE, new.plot = TRUE,
    #                plot.lines = TRUE, plot.points = FALSE, col = NULL, ...)
    # Example 1: Comparing the parameter "MF" between datasets B and C using the Wei fit
    compareParam(B, C, fit = Wei, param = "MF", lwd.lines = 2, col.lines = "#9084c9",
                 simulated = TRUE, seed = 516)

    # Example 2: Comparing the parameter "UF" between datasets B and C using the Wei fit
    # with a different confidence level and alternative hypothesis
    compareParam(B, C, fit = Wei, param = "UF", lwd.lines = 2, col.lines = "#d65b22",
                 simulated = TRUE, seed = 6544, conf.level = 0.99, alternative = "greater")

    # Example 3: Comparing the parameter "alpha" between datasets B and B using the Exponential and Wei fits
    # and returning the comparison results
    results <- compareParam(B, B, fit = c(Exp, Wei), param = "alpha", lwd.lines = 2, col.lines = "#2e337e",
                            simulated = TRUE, seed = 44648)

    # Example 4: Comparing the parameter "MF" between datasets B and C using the Gamma fit
    # and customizing the comparison plot
    compareParam(B, C, fit = Gam, param = "MF", simulated = TRUE, seed = 5959, return = TRUE)
    ## 
    ##  Welch Two Sample t-test
    ## 
    ## data:  MF_GammaSim_Secondary.Neurites and MF_GammaSim_Dendrites
    ## t = 1.773, df = 93.713, p-value = 0.07948
    ## alternative hypothesis: true difference in means is not equal to 0
    ## 95 percent confidence interval:
    ##  -0.005227574  0.092406709
    ## sample estimates:
    ## mean of x mean of y 
    ## 0.8700160 0.8264265

    compareMean

    # Function: compareMean
    #
    # Description: Compare the mean values between two datasets using FRAP fits.
    #
    # Parameters:
    #   - data1: Dataset 1 for comparison.
    #   - data2: Dataset 2 for comparison.
    #   - fit: FRAP fit object(s) to use for the comparison.
    #   - type: Type of recovery curve to use for the comparison (default: "RCB").
    #   - area: Whether to include area normalization in the comparison (default: TRUE).
    #   - stand: Whether to standardize the recovery curves for comparison (default: TRUE).
    #   - simulated: Whether to perform simulated comparisons (default: FALSE).
    #   - Nsim: Number of simulated comparisons to perform (default: 50).
    #   - seed: Seed value for reproducible simulations (default: NA).
    #   - saveable: Whether to enable saving of simulation results (default: TRUE if seed is specified, FALSE otherwise).
    #   - conf.level: Confidence level for the comparison (default: 0.95).
    #   - alternative: Type of alternative hypothesis for the comparison (default: "two.sided").
    #   - return: Whether to return the comparison results (default: FALSE).
    #   - p.value: Whether to include p-values in the comparison results (default: TRUE).
    #   - npoints: Number of points to use for plotting the comparison curve (default: 100).
    #   - new.plot: Whether to create a new plot (default: TRUE).
    #   - plot.lines: Whether to plot lines for the comparison curve (default: TRUE).
    #   - plot.points: Whether to plot points for the comparison curve (default: FALSE).
    #   - col: Color of the comparison curve (default: NULL).
    #   - ...: Additional parameters for the plot function.
    #
    # Usage:
    #   compareMean(data1, data2, fit, type = "RCB", area = TRUE, stand = TRUE,
    #               simulated = FALSE, Nsim = 50, seed = NA, saveable = !is.na(seed),
    #               conf.level = 0.95, alternative = "two.sided", return = FALSE,
    #               p.value = TRUE, npoints = 100, new.plot = TRUE, plot.lines = TRUE,
    #               plot.points = FALSE, col = NULL, ...)
    # Example 1: Comparing the mean values of FRAP fits between datasets B and C using multiple fits
    compareMean(B, C, fit = c(Exp, Gam), lwd.lines = 2,
                col.lines = c("red", "green", "purple"))

    # Example 2: Comparing the mean values of FRAP fits between datasets B and C using the Gam fit
    # and customizing the plot
    compareMean(B, C, fit = Gam, lwd.lines = 2, col.lines = "orange",
                 plot.lines = TRUE, plot.points = TRUE)

    # Example 3: Comparing the mean values of FRAP fits between datasets B and C using the Wei fit
    compareMean(B, C, fit = Wei, lwd.lines = 2, lty.lines = c(2, 1),
                ylim = c(0, 0.2), col.lines = c("red", "#C65153"),
                xdigits = 0, ydigits = 4)
    compareMean(B, C, fit = Wei, lwd.lines = 2, col.lines = "#79189F",
                simulated = TRUE, seed = 486, new.plot = FALSE)

    # Example 4: Comparing the mean values of FRAP fits between datasets B and C using the Exp fit
    compareMean(B, C, fit = Exp, lwd.lines = 2, col.lines = "blue",return = T)[[2]]
    ##   [1]          NA 0.029525886 0.027422980 0.025492571 0.023720499 0.022093724
    ##   [7] 0.020600301 0.019229335 0.017970933 0.016816144 0.015756895 0.014785925
    ##  [13] 0.013896714 0.013083421 0.012340811 0.011664198 0.011049384 0.010492605
    ##  [19] 0.009990487 0.009540001 0.009138429 0.008783335 0.008472540 0.008204102
    ##  [25] 0.007976303 0.007787636 0.007636795 0.007522667 0.007444326 0.007401027
    ##  [31] 0.007392196 0.007417423 0.007476454 0.007569180 0.007695623 0.007855923
    ##  [37] 0.008050327 0.008279167 0.008542848 0.008841830 0.009176611 0.009547712
    ##  [43] 0.009955656 0.010400959 0.010884114 0.011405578 0.011965762 0.012565020
    ##  [49] 0.013203648 0.013881870 0.014599841 0.015357641 0.016155279 0.016992687
    ##  [55] 0.017869728 0.018786197 0.019741822 0.020736275 0.021769168 0.022840066
    ##  [61] 0.023948488 0.025093914 0.026275789 0.027493531 0.028746533 0.030034167
    ##  [67] 0.031355792 0.032710757 0.034098401 0.035518062 0.036969075 0.038450777
    ##  [73] 0.039962510 0.041503620 0.043073462 0.044671400 0.046296806 0.047949065
    ##  [79] 0.049627571 0.051331730 0.053060963 0.054814700 0.056592383 0.058393469
    ##  [85] 0.060217423 0.062063725 0.063931863 0.065821337 0.067731658 0.069662347
    ##  [91] 0.071612931 0.073582950 0.075571949 0.077579483 0.079605113 0.081648406
    ##  [97] 0.083708936 0.085786284 0.087880033 0.089989773

    simFit

    # Function: simFit
    #
    # Description: Simulate fluorescence recovery curves based on a given FRAP fit.
    #
    # Parameters:
    #   - fit: FRAP fit object to use for simulation.
    #   - Nsim: Number of simulations to perform (default: 50).
    #   - seed: Seed for random number generation (default: NA).
    #   - saveable: Whether the simulation results can be saved (default: !is.na(seed)).
    #
    # Usage:
    #   simFit(fit, Nsim = 50, seed = NA, saveable = !is.na(seed))
    #
    # Examples:
    #
    # # Simulate fluorescence recovery curves based on the Wei fit with 100 simulations
    # simFit(Wei(B), Nsim = 100)
    #
    # # Simulate fluorescence recovery curves based on the Exp fit with a specific seed for reproducibility
    # simFit(Exp(C), seed = 12345)
    #
    # # Simulate fluorescence recovery curves based on the Gam fit and save the results
    # simFit(Gam(B), saveable = TRUE)

    tableFit

    # Function: tableFit
    #
    # Description: Create a table summarizing the fit results for multiple FRAP objects.
    #
    # Parameters:
    #   - ...: Multiple FRAP objects or a list of FRAP objects.
    #   - fit: FRAP fit objects to include in the table.
    #   - digits: Number of digits to round the table values (default: 4).
    #
    # Usage:
    #   tableFit(..., fit, digits = 4)
    #
    # Examples:
    #
    # # Create a table summarizing the fit results for objects A, B, and C using the Wei fit
    # tableFit(A, B, C, fit = Wei)
    #
    # # Create a table summarizing the fit results for objects B and C using multiple fits
    # tableFit(B, C, fit = c(Exp, Gam, Wei))
    #
    # # Create a table summarizing the fit results for objects B, C, and D using custom digits
    # tableFit(B, C, D, fit = Exp, digits = 2)

    UP